//
//  ViewController.swift
//  emojiKeyboardDemo
//
//  Created by Jin on 2018/5/16.
//  Copyright © 2018年 Jin. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var myTextView:UITextView!
    
    private lazy var emojiVc = EmotionViewController {[weak self] (emotion) in
        self?.myTextView.insertEmotionToTextView(emotion: emotion)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        myTextView.inputView = emojiVc.view
    }

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        myTextView.becomeFirstResponder()
    }
    
    @IBAction private func sendMessageItemClick(){
        print(myTextView.getTextViewAttributeString())
    }

}

